package me.xingyannian.hope.rest;

import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.util.SaResult;
import me.xingyannian.hope.service.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("sys/user")
public class UserController {
    private UserService userService;

    public UserController(UserService userService) {
        this.userService = userService;
    }

    @GetMapping
    @SaCheckPermission( value = {"sysAdmin:user:list"})
    public SaResult getUsers(){
        return SaResult.data(this.userService.getAllUsers());
    }
}
